﻿sampler2D input : register(s0);
 
float brightness : register(c1);
float contrast : register(c2);
 
float4 main(float2 uv : TEXCOORD) : COLOR
{
    float4 color = tex2D(input, uv);
 
    // Adjust brightness
    color.rgb += brightness;
 
    // Adjust contrast
    float midlevel = 0.5;
    color.rgb = (color.rgb - midlevel) * contrast + midlevel;
 
    return color;
}